<?php
/**
 *
 * @package avp
 * @version $Id: $
 * @copyright (c) 2006 Jan-Willem van Ganswijk, Stefan van Essen
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 */
error_reporting ( E_ERROR | E_WARNING | E_PARSE );
set_magic_quotes_runtime( 0 );

define( 'SCRIPT_VERSION', 'pre0.5-svn' );
// define( 'DEBUG', true );

if( !strstr( $_SERVER['PHP_SELF'], 'install.php' ) && ( is_readable( $root . 'install/install.php' ) || is_readable( $root . 'install/db.sql' ) ) ) {
    die( "Please delete the install folder from your webserver for obvious security reasons." );
}

include( $root . "includes/config.inc.php" );
include( $root . 'includes/database.class.php' );

$db = new dbWrapper( $sql_user, $sql_pass, $sql_server, $sql_database, $sql_prefix );
$CONFIG = $db->query_first("SELECT * FROM `" . $db->get_table( "settings" ) . "` LIMIT 1");

$timer = array();

function timer( $name, $command = 'start', $digits = 2 )
{
    global $timer;
    if( $command == 'start' ) { // starten
        $mtime1 = microtime();
        $mtime1 = explode( " ", $mtime1 );
        $mtime1 = $mtime1[1] + $mtime1[0];
        $timer[$name] = $mtime1;
    } else if( $command == 'stop' ) {
        $mtime2 = microtime();
        $mtime2 = explode( " ", $mtime2 );
        $mtime2 = $mtime2[1] + $mtime2[0];
        $endtime = $mtime2;
        $totaltime = ( $endtime - $timer[$name] );
        $totaltime = round( $totaltime, $digits );
        return $totaltime;
    }
}

$AUTHORS = 'Jan-Willem van Ganswijk (Rostvertol-Mil)
			Stefan van Essen (eXistenZ)';

?>